<template>
    <ui-main title="上传组件 - 组件方式">
        <div class="item one">
            <div style="max-height:400px">
                <ui-uploader ref="up" accept=".zip,.rar,.7z,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.jpg,.jpeg,.bmp,.tif,.png,.txt,.rtf,.wps,.dwg,.dws,.dwt,.dxf,.mkv,.vob,.ifo,.dvd,.mpg,.mpeg,.dat,.mp4,.3gp,.mov,.rm,.ram,.rmvb,.wmv,.asf,.avi,.asx,.flv" :params="params"></ui-uploader>
                <!--<button @click="uploadc" v-if="key">保存</button>-->
                <hr>
                <router-link to="/bui_$bui_uploader">点击查看 : API调用方式说明</router-link>
            </div>
        </div>
        <div class="item three">
            <ui-load-md file="uploader.md"></ui-load-md>
        </div>
    </ui-main>
</template>
<script>
    export default {
        data() {
            return {
                params: { p: 1 },
                uploaderInstance: null
            }
        },
        mounted() {
            setTimeout(() => {
                this.key = { a: 1 }
                this.params = { p: 2 }
            }, 1000)

            this.$on('global:uploadAllfileComplete', () => {
                console.log('全部上传成功!!!')
            })
            this.$on('global:uploadFileError', (v) => {
                console.log(v)
            })
        },
        methods: {
            uploadc() {
                this.uploaderInstance.upload()
            }
        }

    }
</script>

